const config = require("./config/config")
const path = require("path")
const {genJson, genClientModel} = require("./mod/genJson");
const {createOrCleanDir} = require("./mod/common");

const tableDir = path.join(config.clientModelDir, 'jsonTable')
const modelDir = path.join(config.clientModelDir, 'jsonModel')
createOrCleanDir(tableDir, true)
createOrCleanDir(modelDir, false)

// 生成客户端用 json
// 取第3行字段
const clientOrServerRow = 3
const outJsonDir = path.join(config.clientJsonDir, 'json')
const result = genJson(clientOrServerRow, outJsonDir, config.excelDir)
genClientModel(result.excelAndSheets, tableDir, modelDir, '../json')
